package com.yy.myp.utils;

import android.content.Context;

import androidx.appcompat.app.AlertDialog;

public class AlertUtils {

    public interface OnCallBacker {
        void callBack(boolean result);
    }

    public static void alertMessage (Context context, String title, OnCallBacker callBacker) {
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setMessage(title).setPositiveButton("确定", (dialog, id) -> {
            if (null != callBacker) {
                callBacker.callBack(true);
            }
        }).setNegativeButton("取消", (dialog, id) -> {
            if (null != callBacker) {
                callBacker.callBack(false);
            }
        });
        builder.create().show();
    }

}
